$(document).ready(function () {	
	findAllEventLevel();
	$('#next').click(function () {
		//alert(getCookie(eventId));
		//alert("dfgdfg");
		//setEventPlan2Session();
		//redirectPage("lzm/PlanStandard_matchPlan.action?eventID="+getCookie(eventId));
		//ratingEvent();
		//window.location.href="zhzrm.jsp";
		window.location.href="/ag/work/apply4plan2.jsp";
	});
	$('#skip').click(function () {
		//redirectPage("lzm/PlanStandard_matchPlan.action?eventID="+getCookie(eventId));
		window.location.href="zhzrm.jsp";
	});
});

/**
 * 实现页面的定向
 * @param url 传入定向的目标URL
 */
function redirectPage(url){
   $('#mainFrame', window.parent.document).attr("src", url);
}

/**
 * 作获取所有预案等级操作
 */
function ratingEvent() {
    var EId = getCookie(eventId);
	var elId=$('#sltEL').val();
	//alert(elId);
    var url = 'work2/LZMReport_ratingEvent.action';
    var params = {        
        'EId': EId,
		'elId': elId
    };
    jQuery.post(url, params, ratingEventRst, 'json');
	//var timestamp = Date.parse(new Date());
	//$.get("work2/LZMReport_ratingEvent.action?ts="+timestamp+"&EId="+getCookie(eventId),null,checkEmergencyRst);
	//$.get("work/eventBase_getAllEventLevel.action?ts=" + timestamp, null, ratingEventRst);
}
/**
 * 作获取事件类型回调函数
 */
function ratingEventRst(data) {
	if(data.ajaxRst=="success"){
		//redirectPage("lzm/PlanStandard_matchPlan.action?eventID="+getCookie(eventId));
		redirectPage("/ag/lzm/start_plan4s.jsp");
	}else{
		alert("服务器异常，请重试！");
	}	
}

/**
 * 作获取所有预案等级操作
 */
function findAllEventLevel() {
	var timestamp = Date.parse(new Date());
	$.get("wzp/eventBase_getAllEventLevel.action?ts=" + timestamp, null, findAllEventLevelRst);
}
/**
 * 作获取事件类型回调函数
 */
function findAllEventLevelRst(data) {
	var pt = "";
	$.each(data.eventLevels, function (i, n) {
		var tmp = "";
		tmp = "<option value=" + n.elId + ">" + n.elEventLevel + "</option>";
		pt += tmp;
	});
	$("#sltEL").append(pt);
}